package com.aiyige.model;

import android.os.Parcel;
import android.os.Parcelable;

public class WalletDetailEntity implements Parcelable{

    private String id;

    private double amount;

    private long createTime;

    private String describe;

    private double balance;

    private String subject;

    private String type;

    private String fee;

    private String channel;

    private  String status;

    private String remark;

    private String subjectTitle;

    public WalletDetailEntity() {

    }


    public double getAmount() {
        return amount;
    }

    public void setAmount(double amount) {
        this.amount = amount;
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public String getDescribe() {
        return describe == null ? "" : describe;
    }

    public void setDescribe(String describe) {
        this.describe = describe == null ? "" : describe;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }

    public String getSubject() {
        return subject == null ? "" : subject;
    }

    public void setSubject(String subject) {
        this.subject = subject == null ? "" : subject;
    }

    public String getType() {
        return type == null ? "" : type;
    }

    public void setType(String type) {
        this.type = type == null ? "" : type;
    }

    public String getFee() {
        return fee == null ? "" : fee;
    }

    public void setFee(String fee) {
        this.fee = fee == null ? "" : fee;
    }

    public String getChannel() {
        return channel == null ? "" : channel;
    }

    public void setChannel(String channel) {
        this.channel = channel == null ? "" : channel;
    }

    public String getStatus() {
        return status == null ? "" : status;
    }

    public void setStatus(String status) {
        this.status = status == null ? "" : status;
    }

    public String getRemark() {
        return remark == null ? "" : remark;
    }

    public void setRemark(String remark) {
        this.remark = remark == null ? "" : remark;
    }

    public String getSubjectTitle() {
        return subjectTitle == null ? "" : subjectTitle;
    }

    public void setSubjectTitle(String subjectTitle) {
        this.subjectTitle = subjectTitle == null ? "" : subjectTitle;
    }

    /**
     * 是否是进账
     * @return
     */
    public boolean isIncome() {
        return getType().equals("income");
    }


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.id);
        dest.writeDouble(this.amount);
        dest.writeLong(this.createTime);
        dest.writeString(this.describe);
        dest.writeDouble(this.balance);
        dest.writeString(this.subject);
        dest.writeString(this.type);
        dest.writeString(this.fee);
        dest.writeString(this.channel);
        dest.writeString(this.status);
        dest.writeString(this.remark);
        dest.writeString(this.subjectTitle);
    }

    protected WalletDetailEntity(Parcel in) {
        this.id = in.readString();
        this.amount = in.readDouble();
        this.createTime = in.readLong();
        this.describe = in.readString();
        this.balance = in.readDouble();
        this.subject = in.readString();
        this.type = in.readString();
        this.fee = in.readString();
        this.channel = in.readString();
        this.status = in.readString();
        this.remark = in.readString();
        this.subjectTitle = in.readString();
    }

    public static final Creator<WalletDetailEntity> CREATOR = new Creator<WalletDetailEntity>() {
        @Override
        public WalletDetailEntity createFromParcel(Parcel source) {
            return new WalletDetailEntity(source);
        }

        @Override
        public WalletDetailEntity[] newArray(int size) {
            return new WalletDetailEntity[size];
        }
    };
}
